import React, { memo } from "react";
import style from "./sty.module.css";
import Scroll from "@/components/scroll";
import PropTypes from "prop-types";
import { createMarkup } from "@/utils/util";
const Desc = (props) => {
  const { info } = props;
  return (
    <Scroll>
      <div className={style.content}>
        <div style={{ display: info.briefDesc ? "" : "none" }}>
          <div className={style.title}>简介</div>
          <div
            className={style.text}
            dangerouslySetInnerHTML={createMarkup(info.briefDesc)}
          />
        </div>
        {info.introduction &&
          info.introduction.map((item) => (
            <div key={item.ti}>
              <div className={style.title}>{item.ti}</div>
              <div
                className={style.text}
                dangerouslySetInnerHTML={createMarkup(item.txt)}
              />
            </div>
          ))}
      </div>
    </Scroll>
  );
};
Desc.propTypes = {
  info: PropTypes.object,
};
Desc.defaultProps = {
  info: {},
};

export default memo(Desc);
